<!DOCTYPE html>
<html>
<head>
    <th:block th:include="include :: headermain('互助保障系统V3')"/>
    <link href="/plugin/fontawesome/fontawesome.min.css" rel="stylesheet" />

    <title>单位资料-互助保障系统</title>

</head>
<body>
<div class="page">
    <th:block th:include="include :: unLoginTop"/>

    <div class="center">
        <div class="page-content">
            <div class="page-forgot-password">
                <div class="page-tab">
                    <a href="/unit/getUnitPassword">单位账号找回</a>
                    <%-- <a href="/unit/mobileGetPassword">手机号找回密码</a>
                    <a class="on" href="/unit/emailGetPassword">邮箱找回密码</a> --%>
                    <a href="/unit/contactGetPassword">联系管理员找回密码</a>
                </div>
                <h2>邮箱找回密码</h2>
                <form class="page-search" method="post" style="position:static;">
                    <div class="page-form-item">
                        <div class="page-form-label">单位账号：</div>
                        <div class="page-form-input">
                            <input type="text" id="account" style="width:260px" name="account" />
                        </div>
                    </div>
                    <div class="page-form-item">
                        <div class="page-form-label">单位邮箱：</div>
                        <div class="page-form-input">
                            <input type="text" id="email" style="width:120px"  name="email" />
                        </div>
                    </div>
                    <div class="page-form-item">
                        <div class="page-form-input">
                            <a class="layui-btn" id="submitForm"><i class="fa fa-search"></i> 搜索</a>
                        </div>
                    </div>
                </form>

            </div>
        </div>
    </div>
    <th:block th:include="include :: footer"/>
</div>

<script src="/footerjs.js"></script>


<script type="text/javascript">


    $("#submitForm").click(function () {
        var account = $("#account").val();
        var email = $("#email").val();
        if(!account){
            layer.msg("请输入单位账号！");
        }else if(!email){
            layer.msg("请输入单位邮箱！");
        }else{
            $.ajax({
                url: "${ctx}/unit/checkEmail",
                data: $(".page-search").serialize(),
                success: function (data) {
                    if (data.success) {
                        layer.msg("操作成功，新密码已发送到您输入的单位联系邮箱中，请注意查收！");
                    } else {
                        layer.msg(data.msg);
                    }
                }
            });
        }

    });

</script>

</body>
</html>
